/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rationalsheet.parser.type;

/**
 *
 * @author Overmind
 */
public class TrimType<T>
    extends Type<T>
{
    private Type<T> type;
    
    protected TrimType(Type<T> type)
    {
	super(type.getName());
	this.type = type;
    }
    
    @Override
    public T valueOfString(String string) throws NumberFormatException
    {
	return type.valueOfString(string.trim());
    }

    @Override
    public String objectToString(T value)
    {
	return type.objectToString(value);
    }
}
